﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nuzzle.Protocol.Types.Game.Context.Roleplay
{
    public class HumanInformations
    {
        public byte EmoteID { get; set; }
        public double EmoteStartTime { get; set; }
        public short TitleID { get; set; }
        public string TitleParam { get; set; }
        public Character.Restriction.ActorRestrictionsInformations Restrictions { get; set; }

        public HumanInformations(byte emoteID, double emoteStartTime, short titleID, string titleParam)
        {
            this.EmoteID = emoteID;
            this.EmoteStartTime = emoteStartTime;
            this.TitleID = titleID;
            this.TitleParam = titleParam;
            this.Restrictions = new Character.Restriction.ActorRestrictionsInformations();
        }

        public void Serialize(NetworkMessage message)
        {
            message.WriterBuffer.writeShort(0);//Following characters look

            message.WriterBuffer.writeByte(this.EmoteID);
            message.WriterBuffer.writeDouble(this.EmoteStartTime);
            this.Restrictions.Serialize(message);
            message.WriterBuffer.writeShort(this.TitleID);
            message.WriterBuffer.writeUTF(this.TitleParam);
        }
    }
}
